package com.aistar.order.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

        import java.io.IOException;
        import javax.servlet.ServletException;
        import javax.servlet.annotation.WebServlet;
        import javax.servlet.http.HttpServlet;
        import javax.servlet.http.HttpServletRequest;
        import javax.servlet.http.HttpServletResponse;

        import java.util.Map;

/**
 * 测试支付功能的处理接收的异步通知回调方法
 *
 * @author chgl16
 * @date 2018-11-20
 * @version 1.0
 */
@WebServlet("/PayServlet")
public class PayServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("进入doPost");
        String total_amount = request.getParameter("total_amount");
        System.out.println("total_amount: " + total_amount);
        Map<String, String[]> map = request.getParameterMap();
        System.out.println("输出参数集合: " + map.toString());
        response.getWriter().write("success");
        System.out.println("结束了");
    }
}
